import 'package:built_collection/built_collection.dart';
import 'package:equatable/equatable.dart';
import 'package:learning_content_admin_pannel.core/core/domain/entities/learning_content/lexical_item/lexical_item.dart';
import 'package:learning_content_admin_pannel.home.words/single_word_base_page/domain/entities/part_of_speech.dart';
import 'package:learning_content_admin_pannel.home.words/single_word_base_page/domain/entities/word_base_use_case_input.dart';

class WordBaseInput extends Equatable {
  const WordBaseInput({
    required this.id,
    required this.title,
    required this.rank,
    required this.amTranscription,
    required this.brTranscription,
    required this.partOfSpeech,
    required this.cefrLevel,
    required this.definition,
    required this.useCaseInputs,
  });

  final String id;
  final String title;
  final int? rank;
  final String amTranscription;
  final String brTranscription;
  final PartOfSpeech? partOfSpeech;
  final CefrLevel? cefrLevel;
  final String definition;
  final BuiltList<WordBaseUseCaseInput> useCaseInputs;

  @override
  List<Object?> get props {
    return [
      id,
      title,
      rank,
      amTranscription,
      brTranscription,
      partOfSpeech,
      cefrLevel,
      definition,
      useCaseInputs,
    ];
  }

  WordBaseInput copyWith({
    String Function()? id,
    String Function()? title,
    int? Function()? rank,
    String Function()? amTranscription,
    String Function()? brTranscription,
    PartOfSpeech? Function()? partOfSpeech,
    CefrLevel? Function()? cefrLevel,
    String Function()? definition,
    BuiltList<WordBaseUseCaseInput> Function()? useCaseInputs,
  }) {
    return WordBaseInput(
      id: id == null ? this.id : id(),
      title: title == null ? this.title : title(),
      rank: rank == null ? this.rank : rank(),
      amTranscription: amTranscription == null ? this.amTranscription : amTranscription(),
      brTranscription: brTranscription == null ? this.brTranscription : brTranscription(),
      partOfSpeech: partOfSpeech == null ? this.partOfSpeech : partOfSpeech(),
      cefrLevel: cefrLevel == null ? this.cefrLevel : cefrLevel(),
      definition: definition == null ? this.definition : definition(),
      useCaseInputs: useCaseInputs == null ? this.useCaseInputs : useCaseInputs(),
    );
  }
}
